<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>所有表单相关</title>
    <link rel="stylesheet" href="../basestyle.css">
    <!--<link rel="stylesheet" href="../weui.css">-->
    <link rel="stylesheet" href="../agree.css">
    <link rel="stylesheet" href="../switch.css">
    <link rel="stylesheet" href="../icon.css">
    <link rel="stylesheet" href="./input.css">
</head>
<body>
<div class="page">
    <div class="page__bd">

        <div class="cells__title">单选列表项</div>
        <div class="cells cells_radio">
            <label class="cell check__label" for="x11">
                <div class="cell__bd">
                    <p>单选选项一</p>
                </div>
                <div class="cell__ft">
                    <input type="radio" class="check" name="radio1" id="x11">
                    <span class="icon-checked"></span>
                </div>
            </label>
            <label class="cell check__label" for="x12">

                <div class="cell__bd">
                    <p>单选选项二</p>
                </div>
                <div class="cell__ft">
                    <input type="radio" name="radio1" class="check" id="x12" checked="checked">
                    <span class="icon-checked"></span>
                </div>
            </label>
            <a href="javascript:void(0);" class="cell cell_link">
                <div class="cell__bd">添加更多</div>
            </a>
        </div>
        <div class="cells__title">复选列表项</div>
        <div class="cells cells_checkbox">
            <label class="cell check__label" for="s11">
                <div class="cell__hd">
                    <input type="checkbox" class="check" name="checkbox1" id="s11" checked="checked">
                    <i class="icon-checked"></i>
                </div>
                <div class="cell__bd">
                    <p>多选选项一</p>
                </div>
            </label>
            <label class="cell check__label" for="s12">
                <div class="cell__hd">
                    <input type="checkbox" name="checkbox1" class="check" id="s12">
                    <i class="icon-checked"></i>
                </div>
                <div class="cell__bd">
                    <p>多选选项二</p>
                </div>
            </label>
            <a href="javascript:void(0);" class="cell cell_link">
                <div class="cell__bd">添加更多</div>
            </a>
        </div>

        <div class="cells__title">表单</div>
        <div class="cells cells_form">
            <div class="cell">
                <div class="cell__hd"><label class="label">qq</label></div>
                <div class="cell__bd">
                    <input class="input" type="number" pattern="[0-9]*" placeholder="请输入qq号"/>
                </div>
            </div>
            <div class="cell cell_vcode">
                <div class="cell__hd">
                    <label class="label">手机号</label>
                </div>
                <div class="cell__bd">
                    <input class="input" type="tel" placeholder="请输入手机号">
                </div>
                <div class="cell__ft">
                    <button class="vcode-btn">获取验证码</button>
                </div>
            </div>
            <div class="cell">
                <div class="cell__hd"><label for="" class="label">日期</label></div>
                <div class="cell__bd">
                    <input class="input" type="date" value=""/>
                </div>
            </div>
            <div class="cell">
                <div class="cell__hd"><label for="" class="label">时间</label></div>
                <div class="cell__bd">
                    <input class="input" type="datetime-local" value="" placeholder=""/>
                </div>
            </div>
            <div class="cell cell_vcode">
                <div class="cell__hd"><label class="label">验证码</label></div>
                <div class="cell__bd">
                    <input class="input" type="number" placeholder="请输入验证码"/>
                </div>
                <div class="cell__ft">
                    <img class="vcode-img" src="../images/vcode.jpg" />
                </div>
            </div>
        </div>
        <div class="cells__tips">底部说明文字底部说明文字</div>

        <div class="cells__title">表单报错</div>
        <div class="cells cells_form">
            <div class="cell cell_warn">
                <div class="cell__hd"><label for="" class="label">卡号</label></div>
                <div class="cell__bd">
                    <input class="input" type="number" pattern="[0-9]*" value="weui input error" placeholder="请输入卡号"/>
                </div>
                <div class="cell__ft">
                    <i class="icon-warn"></i>
                </div>
            </div>
        </div>


        <div class="cells__title">开关</div>
        <div class="cells cells_form">
            <div class="cell cell_switch">
                <div class="cell__bd">标题文字</div>
                <div class="cell__ft">
                    <input class="switch" type="checkbox"/>
                </div>
            </div>
            <div class="cell cell_switch">
                <div class="cell__bd">兼容IE Edge的版本</div>
                <div class="cell__ft">
                    <label for="switchCP" class="switch-cp">
                        <input id="switchCP" class="switch-cp__input" type="checkbox" checked="checked" />
                        <div class="switch-cp__box"></div>
                    </label>
                </div>
            </div>
        </div>

        <div class="cells__title">文本框</div>
        <div class="cells">
            <div class="cell">
                <div class="cell__bd">
                    <input class="input" type="text" placeholder="请输入文本"/>
                </div>
            </div>
        </div>

        <div class="cells__title">文本域</div>
        <div class="cells cells_form">
            <div class="cell">
                <div class="cell__bd">
                    <textarea class="textarea" placeholder="请输入文本" rows="3"></textarea>
                    <div class="textarea-counter"><span class="textarea_length">0</span>/200</div>
                </div>
            </div>
        </div>
        <script>
            document.getElementsByClassName("textarea")[0].addEventListener("keyup",function (e) {
                if(this.value.length<=200){
                    document.getElementsByClassName("textarea_length")[0].innerHTML=this.value.length;
                }else{
                    alert("文字超长")
                }
            })
        </script>
        <div class="cells__title">选择</div>
        <div class="cells">

            <div class="cell cell_select cell_select-before">
                <div class="cell__hd">
                    <select class="select" name="select2">
                        <option value="1">+86</option>
                        <option value="2">+80</option>
                        <option value="3">+84</option>
                        <option value="4">+87</option>
                    </select>
                </div>
                <div class="cell__bd">
                    <input class="input" type="number" pattern="[0-9]*" placeholder="请输入号码"/>
                </div>
            </div>
        </div>
        <div class="cells__title">选择</div>
        <div class="cells">
            <div class="cell cell_select">
                <div class="cell__bd">
                    <select class="select" name="select1">
                        <option selected="" value="1">微信号</option>
                        <option value="2">QQ号</option>
                        <option value="3">Email</option>
                    </select>
                </div>
            </div>
            <div class="cell cell_select cell_select-after">
                <div class="cell__hd">
                    <label for="" class="label">国家/地区</label>
                </div>
                <div class="cell__bd">
                    <select class="select" name="select2">
                        <option value="1">中国</option>
                        <option value="2">美国</option>
                        <option value="3">英国</option>
                    </select>
                </div>
            </div>
        </div>


        <label for="weuiAgree" class="agree">
            <input id="weuiAgree" type="checkbox" class="agree__checkbox">
            <span class="agree__text">
                阅读并同意<a href="javascript:void(0);">《相关条款》</a>
            </span>
        </label>
        <link rel="stylesheet" href="../button/button.css">

        <div class="toptips toptips_warn js_tooltips" style="display: none;">错误提示</div>
        <div class="btn-area">
            <a class="btn btn_primary" href="javascript:" id="showTooltips">确定</a>
        </div>
        <!--<script src="../tips.js"></script>-->
        <script>
            /**
             *
             * @param msg       String 提示内容
             * @param delay     Number 提示信息持续时间,毫秒做单位
             * @param type      Boolearn 提示的类型
             */
            function tips(msg,delay,type) {
                var tip=document.createElement("div");
                tip.innerHTML=msg;
                tip.setAttribute("style","display:block;position: fixed;-webkit-transform: translateZ(0);transform: translateZ(0);top: 0;left: 0;right: 0;padding: 5px;font-size: 0.14rem;text-align: center;color: #FFF;z-index: 5000;word-wrap: break-word;word-break: break-all;")
                if(type==true){
                    tip.style.backgroundColor="#E64340"
                }else if(type==false){
                    tip.style.backgroundColor="#3CC51F"
                }
                document.body.appendChild(tip);
                setTimeout(function () {
                    document.body.removeChild(tip)
                },delay)
            }

            document.getElementById("showTooltips").onclick=function (e) {
                var js_tooltips=document.getElementsByClassName("js_tooltips")[0];
                js_tooltips.style.display="block";
                setTimeout(function () {
                    js_tooltips.style.display="none";
                },1500)
            }
        </script>
    </div>
</div>
</body>
</html>